[SEA-NodeJS] feat(kernel): proxy + socketTimeout ConnectionOptions on the kernel backend#431
Conversation
|
Thanks for your contribution! To satisfy the DCO policy in our contributing guide every commit message must include a sign-off message. One or more of your commits is missing this message. You can reword previous commit messages with an interactive rebase ( |
|
Thanks for your contribution! To satisfy the DCO policy in our contributing guide every commit message must include a sign-off message. One or more of your commits is missing this message. You can reword previous commit messages with an interactive rebase ( |
|
Thanks for your contribution! To satisfy the DCO policy in our contributing guide every commit message must include a sign-off message. One or more of your commits is missing this message. You can reword previous commit messages with an interactive rebase ( |
…n on the kernel backend
Map the public Thrift-shaped `ConnectionOptions.proxy`
(`{protocol, host, port, auth}`) onto the kernel napi binding's
`proxy?: string`, so the SAME proxy connection option that works on the
Thrift backend now also routes kernel/SEA traffic through a proxy.
`buildKernelProxyOptions` composes `protocol://[user:pass@]host:port`,
percent-encoding any `auth.{username,password}` into the URL userinfo so
credentials with reserved characters survive; the kernel parses the
userinfo off and applies it as proxy basic-auth. Wired into
`buildKernelConnectionOptions` alongside the TLS / HTTP option builders.
The regenerated napi contract (`native/kernel/index.d.ts`) carries the
new `proxy?: string` and `socketTimeoutMs?: number` fields exposed by the
kernel PR (databricks/databricks-sql-kernel#129).
Note: env-var proxying (`HTTPS_PROXY` / `HTTP_PROXY` / `NO_PROXY`) already
worked on the kernel backend (reqwest honours it natively); this adds the
*programmatic* path for callers who cannot set process env vars.
Verified end-to-end via mitmproxy against a live serverless warehouse:
explicit `proxy` option (no env var) routes all SEA calls through the
proxy; a dead proxy port fails the connection (proving the proxy is used).
Co-authored-by: Isaac
Signed-off-by: Madhavendra Rathore <madhavendra.rathore@databricks.com>
…o the kernel The kernel napi binding exposes `socketTimeoutMs` (kernel `HttpConfig::request_timeout` / reqwest `Client::timeout`, kernel #129). Map the public `socketTimeout` ConnectionOption (ms) onto it in `buildKernelHttpOptions`, so the per-connection read timeout works on the kernel backend just like the Thrift path. Only a positive value is forwarded: `socketTimeout: 0` means "disabled / wait indefinitely" on Thrift, but forwarding `0` would make reqwest time out immediately, so it is omitted (kernel keeps its large default). Verified directly against a live serverless warehouse: `socketTimeout: 1` makes a SEA request time out. Co-authored-by: Isaac Signed-off-by: Madhavendra Rathore <madhavendra.rathore@databricks.com>
…ed object Change the kernel proxy mapping from a flattened URL string to the structured napi `proxy` object (kernel #129), mirroring the kernel's internal ProxyConfig: `{ url, username?, password?, bypassHosts? }`. `buildKernelProxyOptions` now composes `url` from `protocol://host:port` (no embedded credentials) and forwards `auth.{username,password}` as separate basic-auth fields — eliminating the URL percent-encoding of credentials. The `noProxy` host list is forwarded as `bypassHosts` (previously unexpressible through the URL-string form). Regenerated napi contract (native/kernel/index.d.ts) carries the new `ProxyInput` object type. Verified via mitmproxy (HttpProxyTests, SEA leg): http / https / proxy-with-auth all route through the proxy and the query succeeds. Co-authored-by: Isaac Signed-off-by: Madhavendra Rathore <madhavendra.rathore@databricks.com>
Point the bundled kernel binding at the latest kernel main — the v0.2.0 beta release (databricks/databricks-sql-kernel@0d46716), which includes the merged proxy + per-connection socketTimeout napi surface (#129) this PR maps onto, plus the query-tags wire support (#150). The kernel-e2e CI gate builds the napi from this SHA. Verified: proxy routes through mitmproxy and SELECT round-trips on the v0.2.0 binding. Co-authored-by: Isaac Signed-off-by: Madhavendra Rathore <madhavendra.rathore@databricks.com>
af390eb to
e80af04
Compare
What
Wires two transport ConnectionOptions through to the kernel/SEA backend, at Thrift parity:
proxy: { protocol, host, port, auth }— the same structured proxy option the Thrift path accepts now also routes kernel/SEA traffic.buildKernelProxyOptionscomposesprotocol://[user:pass@]host:port(credentials percent-encoded into the userinfo) and forwards it to the kernel napiproxy?: string(kernelProxyConfig.url).socketTimeout(ms) — mapped onto the kernel napisocketTimeoutMs(kernelHttpConfig::request_timeout/ reqwestClient::timeout) inbuildKernelHttpOptions. Only a positive value is forwarded;socketTimeout: 0("disabled") is omitted so reqwest keeps its large default rather than timing out immediately.The regenerated napi contract (
native/kernel/index.d.ts) picks up theproxy?: string+socketTimeoutMs?: numberfields from the kernel side — databricks/databricks-sql-kernel#129 (required companion).Note: env-var proxying (
HTTPS_PROXY/HTTP_PROXY/NO_PROXY) already worked on the kernel backend (reqwest honours those natively). This PR adds the programmatic path for callers who cannot set process env vars.Verification
End-to-end via mitmproxy,
useKernel: trueagainst a live serverless SQL warehouse, plus the driver-test suite:proxy(no env var) → every SEA call (POST /sessions,POST /statements,GET …,DELETE …) intercepted;SELECTreturns the expected row.socketTimeout: 1→ a live SEA request times out (read-timeout fires).HttpProxyTests(SEA leg): http / https / proxy-with-auth all pass through mitmproxy.eslint+prettierclean;tscbuild green.Dependency
Requires kernel PR databricks/databricks-sql-kernel#129 (the napi
proxy/socketTimeoutMsfields). The contract bump innative/kernel/index.d.tsreflects that binding.This pull request and its description were written by Isaac.